{include file="public/header"/}
</head>
<body>
<div class="layui-form">
    <div class="layui-fluid pd83">
        <div class="layui-row layui-col-space15">
            <div class="layui-col-sm12">
                <div class="layui-card pcf30">
                    <div class="layui-form-item">
                        <label class="layui-form-label"><b class="pcfts">*</b> 级别名称</label>
                        <div class="layui-input-inline pcfcms_layui-input-inline">
                            <input type="text" name="level_name" class="layui-input" value="{$info.level_name}" lay-verify="required"/>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">每日发布</label>
                        <div class="layui-input-inline pcfcms_layui-input-inline">
                            <input type="text" name="free_day_send" class="layui-input" value="{$info.free_day_send}"/>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">共发布</label>
                        <div class="layui-input-inline pcfcms_layui-input-inline">
                            <input type="text" name="free_all_send" class="layui-input" value="{$info.free_all_send}"/>
                        </div>
                    </div> 
                    <div class="layui-form-item">
                        <label class="layui-form-label">每日下载</label>
                        <div class="layui-input-inline pcfcms_layui-input-inline">
                            <input type="text" name="fee_day_top" class="layui-input" value="{$info.fee_day_top}"/>
                        </div>
                    </div> 
                    <div class="layui-form-item">
                        <label class="layui-form-label">共下载</label>
                        <div class="layui-input-inline pcfcms_layui-input-inline">
                            <input type="text" name="fee_all_top" class="layui-input" value="{$info.fee_all_top}"/>
                        </div>
                    </div>
                    <input type="hidden" name="id" class="layui-input" value="{$info.id}"/>
                    <div class="pcfclear"></div>
                </div>
            </div>
        </div>
    </div>
    <div class="submit-info text-center">
        <button class="layui-btn" lay-submit lay-filter="formSubmit">确认提交</button>
        <button class="layui-btn layui-btn-primary" type="button" ew-event="closeDialog">取消</button>
    </div>  
</div>
{include file="public/footer"/}
<script>
    layui.use(['layer', 'form'], function () {
        var $ = layui.jquery;
        var layer = layui.layer;
        var form = layui.form;
        form.render();
        //监听提交
        form.on('submit(formSubmit)', function(data){
            layer.msg('正在处理请勿刷新页面', {icon: 16,shade: 0.01,time:3600000});
            $.ajax({
                type : 'post',
                url : "{:url('/userslevel/edit')}",
                data : data.field,
                dataType : 'json',
                success : function(res){
                    layer.closeAll();
                    if(res.status){
                        layer.msg(res.msg,{icon:1,time:1000},function(){
                            parent.window.location.href = res.url;
                        });
                    }else{
                        layer.msg(res.msg, {icon: 2, time: 1000});
                    }
                },
                error: function(e){
                    layer.closeAll();
                    layer.msg("未知错误，操作中断！", {icon: 2, time: 1000});
                }
            });
            return false;
        });
    });
</script>
</body>
</html>